/*
 * Created on 08.06.2007
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ro.qi.framework.sys.users.entities;

import ro.qi.framework.sys.entities.Entity;

/**
 * @author George Pogorelschi
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class UsersAccountCollection extends Entity {

	public UsersAccountCollection() {
	}

	public UsersAccountCollection(String searchQuery) {
		super();
		setLogin(searchQuery);
		setEmail(searchQuery);
		setFirstName(searchQuery);
		setFamilyName(searchQuery);
		select();
	}

	public void setLogin(String value) {
		setValue("login", value);
	}

	public void setEmail(String value) {
		setValue("email", value);
	}

	public void setFirstName(String value) {
		setValue("firstName", value);
	}

	public void setFamilyName(String value) {
		setValue("familyName", value);
	}

	public int getCollectionSize() {
		return getCollectionSize("accounts");
	}
	
	public int getId(int index) {
		return getCollectionIntValue("accounts", "id", index);
	}

	public UsersAccount getAccount(int index) {
		return new UsersAccount(getId(index));
	}
	
}
